#!/usr/bin/env node

const Radio = require('./04-radio');

const station = {
    freq: '106.7',
    name: 'music radio'
};

const radio = new Radio(station);

radio.on('open', (station) => {
    console.log('"%s" FM %s opened', station.name, station.freq);
    console.log('lalala...');
});

radio.on('open', (station) => {
    console.log('hello', station);
    console.log('\n eventNames', radio.eventNames());
    console.log('\n open listener count:', radio.listenerCount('open'));
    console.log('\n open listeners:', radio.listeners('open'));
});

radio.on('stop', (station) => {
    console.log('"%s" FM %s closed', station.name, station.freq);
});